/*
 * LineString
 * 
 * initial implementation : 28.8.2007
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see Petra.Gis.License.txt
 */
using System;
//using System.Collections.Generic;
//using System.Text;
using Petra.Gis.Geometry.Support;


namespace Petra.Gis.Geometry
{
  /// <summary>
  /// LineString is simple linear geometry (polyline) with following constraint:
  /// LineString must contain at least 2 points
  /// </summary> 
  public class LineString : Curve
  {
    private CoordinateList _CoordinateList;



    static LineString()
    {

    }



    public override CoordinateList coordList {
      get { return _CoordinateList; }
      set {
        //validate min num of points !!
        if (value.Count < 2)
          throw new ArgumentException("coordList for linestring must have at least 2 points");
        _CoordinateList = value;
      }
    }




    internal override BoundingBox getEnvelope()
    {
      _envelope = _CoordinateList.getEnvelope();
      return _envelope;
    }
  }
}
